﻿using Inovout.Services;
using Inovout.YunYao.Models;
using Inovout.YunYao.Services;
using System.Web.Mvc;

namespace Inovout.YunYao.Solutions.Web.Controllers
{
    [AllowAnonymous]
    public class MonitoringNodeController : MonitoringElementController<MonitoringNode>
    {
        public override ActionResult List()
        {
            return base.View(base.Solution.MonitoringNodes);
        }
        public override ActionResult Create(int? id)
        {
            IMonitoringElementService<Feature> featureLocationService = ComponentRegistry.Resolve<IMonitoringElementService<Feature>>();
            ViewBag.Features = featureLocationService.FindAllBySolutionId(base.Solution.Id);
            IMonitoringElementService<MonitoringObject> monitoringObjectService = ComponentRegistry.Resolve<IMonitoringElementService<MonitoringObject>>();
            ViewBag.MonitoringObjects = monitoringObjectService.FindAllBySolutionId(base.Solution.Id);
            return base.Create(id);
        }
    }
}
